/*
 * player.h - multimedia player GUI
 *
 * Copyright (C) 2010-2011 Serge Begger
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PLAYER_H
#define PLAYER_H

#include <QWidget>
#include <QTimer>
#include <QTime>
#include <QSettings>

#include "pllist.h"
#include "qcarpcdialog.h"
#include "gstengine.h"

namespace Ui {
    class player;
}

class player : public QWidget
{
    Q_OBJECT

public:
    explicit player(QWidget *parent = 0);
    ~player();
    void init();
    void play();
    void stop();
    void pause();
    double currEQBand[10];
    gstengine *gstEngine;
    void playPath(QString);
    int currVolume;
    void setVolume(int vol);

private:
    Ui::player *ui;
    QSettings *settings;
    QTimer *timer;
    pllist *playlist;
    bool isPlayed, isPrevPlay, isFlacApe;
    int currTrack, startTime, lenTime;
    bool setTrack();

public slots:
    void on_nextButton_pressed();

signals:
    void hideWidget();

private slots:
    void on_backButton_pressed();
    void on_closeButton_pressed();
    void on_pllistButton_pressed();
    void on_playButton_pressed();
    void on_stopButton_pressed();
    void on_prevButton_pressed();
    void on_positionSlider_actionTriggered(int);
    void on_positionSlider_sliderMoved(int);
    void unHide();
    void updateSlider();
};

#endif // PLAYER_H
